using System.Web.Mvc;
using AutoMapper;

namespace SapaFinance.OOMap
{
       public class AutoMapperConfiguration
    {
           private readonly IDependencyResolver _container;
           public IMappingEngine Engine { get; private set; }

           public AutoMapperConfiguration(IDependencyResolver container)
           {
               _container = container;
               Mapper.Initialize(x =>
                                  {
                                      x.ConstructServicesUsing(_container.GetService);
                                      x.AddProfile<DomainToViewModelMappingProfile>();
                                  });
               this.Engine = Mapper.Engine;
           }

    }
}
